package com.smartstate.dataManagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartstate.dataManagement.entity.Equipment;
import com.smartstate.dataManagement.entity.ObjMiddle;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ObjMiddleMapper extends BaseMapper<ObjMiddle> {

    @Select("select objId from objmiddle where deviceId = #{deviceId}")
    List<String> findByDeviceId(String deviceId);

    @Insert("insert INTO objmiddle (objid,deviceId) values (#{space}, #{deviceId}) ")
    void save(String space, String deviceId);

    @Delete("delete from objmiddle where deviceId = #{deviceId}")
    void deleteByDeviceId(String deviceId);

    @Select("select deviceId from objmiddle where objId = #{objId}")
    List<ObjMiddle> selectByObjId(String objId);
}
